99问答网
所有问题
当前搜索:
python打印五遍hello world
python
hello
world
出错 >>>pirnt 'hello world' File "<stdin>...
答:
如果你的
python
版本是3.0或以上,print被改成了一个函数要这样用print('
hello
,
world
')你那种用法只在2.X的版本中管用。
python
新手求教
答:
版本问题,教材一般讲解的都是2.x版本,在2.x版本中,这样写是对的 但我怀疑你下载的是3.x版本,和2.x版本相比,部分语句的语法不同 print("
hello
world
")这样才对
python 中
如何提取字母?
答:
>>> a = 'hello123 world@#$!'>>> a1=''.join([x for x in a if x.isalpha()])>>> a1'
helloworld
' 简略形式:>>> a1=''.join(x for x in a if x.isalpha())>>> a1'helloworld'
python
怎么print
hello
world
'
答:
你不是已经写出来了么。。。print '
hello
world
'
python
3 和 python 2 略有差异,要写成 print('hello world')
python
IDLE 为什么我输给入
hello
,
world
运行不了。
答:
交互环境,输入print("
hello
world
"),然后回车,如果是创建了py文件,则在编写环境按F5键执行即可。
为什么print语句
python
2.x,3.x语句全能运行
答:
在
Python
2和Python3中都提供print()方法来
打印
信息,但两个版本间的print稍微有差异 主要体现在以下几个方面:1.
python
3中print是一个内置函数,有多个参数,而python2中print是一个语法结构;2.Python2打印时可以不加括号:print '
hello
world
', Python3则需要加括号 print("hello world")
python的
IDLE是什么意思?
答:
回答:输入python,打开的是
python的
运行窗口你输入:print
hello
world
就完成第一步了,print,顾名思意,
打印
的意思你在开始菜单 所有程序的
Python
里能看到一个idle(python GUI)的东西,那就是IDLE了
为什么在
python
下编写print ‘
hello
world
’ 提示invalid syntax_百度...
答:
是用的
Python
3吗?Python3里已经把print改为函数,需要加括号。Python2里则不需要加括号。
刚学
python
这个问题怎么解,不知道怎么运行
hello
python
world
答:
首先 确保你电脑上安装了
python
并设置了环境变量 其次 你的电脑桌面上得创建了python_work这个文件夹 最后 这个文件夹里得有
hello
_
world
.py这个python文件 然后 你才能运行书上的命令,运行这个程序
Python
程序使用()进行多行注释。
答:
①
Python
多行注释不支持嵌套,所以下面的写法是错误的:'''外层注释 '''内层注释 '''2、不管是多行注释还是单行注释,当注释符作为字符串的一部分出现时,就不能再将它们视为注释标记,而应该看做正常代码的一部分,例如:print('''
hello
,
world
!''')print("""www.oldboyedu.com""")print("#是...
棣栭〉
<涓婁竴椤
5
6
7
8
10
11
12
9
13
14
涓嬩竴椤
灏鹃〉
其他人还搜